<!--
<template>
  <RenderByJson ref="content" v-if="vnode" :vnode="vnode"></RenderByJson>
</template>

<script setup>
import {onBeforeMount, onMounted, ref, useAttrs} from "vue";
import { api } from "@/boot/axios";
import { useRoute } from "vue-router";
import { deepAssign } from "dlsjs";

const props = defineProps({
  viewCode: String,
  permConfig: Object
});
const route = useRoute();
const content = ref();
const vnode = ref();

onBeforeMount(async () => {
  const res = await api.sendAxios("/lc_view_config/active/{key}", { key: props.viewCode || route.params.viewCode });
  vnode.value = res.data.content.vnode;
  if (props.permConfig) {
    if (props.permConfig.uuid) {
      deepAssign(vnode.value, props.permConfig, (a, b) => a.uuid === b.uuid);
    } else {
      deepAssign(vnode.value, props.permConfig);
    }
  }
  setTimeout(() => {
    getRefScope()
  },2000)
});

function getRefScope() {
  return content.value.allScope.refScope
}

defineExpose({ contentRef: content });
</script>

<style scoped></style>
-->
